package com.data;

import java.util.List;

public class DbImporter {
	
	public DbImporter () {}

	public static void loadAvailableDesignComponentsTypes (List <Byte> list) {
		// TODO: Change this for a query.
		list.add(IdManager.THEME_PREFIX);
		list.add(IdManager.SCREEN_PREFIX);
		list.add(IdManager.MENU_PREFIX);
		list.add(IdManager.ENTRY_PREFIX);
		list.add(IdManager.BANNER_PREFIX);
		list.add(IdManager.BUTTON_PREFIX);
		list.add(IdManager.IMAGE_PREFIX);
		list.add(IdManager.TEXT_PREFIX);
	}
	
	public static String getComponentTypeName(byte prefix) {
		return IdManager.COMPONENT_TYPES.get(prefix);
	}
	
	public static byte getComponentTypeId(String name){
		if (name.equalsIgnoreCase("Template")) return IdManager.TEMPLATE_PREFIX;
		else if (name.equalsIgnoreCase("Theme")) return IdManager.THEME_PREFIX;
		else if (name.equalsIgnoreCase("Button")) return IdManager.BUTTON_PREFIX;
		else if (name.equalsIgnoreCase("Screen")) return IdManager.SCREEN_PREFIX;
		else if (name.equalsIgnoreCase("Menu")) return IdManager.MENU_PREFIX;
		else if (name.equalsIgnoreCase("Text")) return IdManager.TEXT_PREFIX;
		else if (name.equalsIgnoreCase("Image")) return IdManager.IMAGE_PREFIX;
		else if (name.equalsIgnoreCase("Banner")) return IdManager.BANNER_PREFIX;
		else return IdManager.ENTRY_PREFIX;
	}
}
